#!/usr/bin/env python
# -*- coding: utf-8 -*-


import time
import calendar
import os
import math


content = dir(math)


print content


for item in content:
    if item == 'log1p':
        print '错误变量:'+item






fileinfo = open('demo.txt','r+')

print fileinfo.name

st = fileinfo.read()
print "读取的字符串是 : ", st
fileinfo.close()


# os.rename('data.json', 'data.txt')

# os.remove('data.txt')

# os.mkdir('test', 755)

# os.chdir('test')


# os.rmdir('inc')

print os.getcwd()

timeObj = time.struct_time(time.localtime(time.time()))

print calendar.month(timeObj.tm_year, timeObj.tm_mon)

print time.localtime(time.time())


print time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())


# domain = raw_input("请输入你的域名:")
#
# print "你的域名是:", domain


try:
    fh = open('abc.txt', 'w')
    fh.write('welcome python')
except IOError:
    print "Error: 没有找到文件或读取文件失败"
else:
    print "内容写入成功"
    fh.close()
